﻿Public Class NumToStringConverter
    Implements IValueConverter
    Private Shared Values() As String = {"不使用代理", "使用自定义代理", "使用IE代理"}

    Public Shared ReadOnly Property ProxyTypes() As String()
        Get
            Return Values
        End Get
    End Property

    Public Function Convert(value As Object, targetType As System.Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.Convert
        Return Values(CInt(value))
    End Function

    Public Function ConvertBack(value As Object, targetType As System.Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.ConvertBack
        Return Array.IndexOf(Values, value)
    End Function
End Class
